package com.woniu.command.repaircommand;

import com.woniu.command.Command;
import com.woniu.command.handler.AppCommandHandler;
import com.woniu.command.handler.RepairAppCommandHandler;
import com.woniu.outlet.po.ApplicationDetail;
import com.woniu.outlet.po.RepairApplication;
import com.woniu.util.ApplicationContextHolder;

public class AddRepairApplicationCommand implements Command<RepairApplication> {

    private RepairAppCommandHandler handler;

    public AddRepairApplicationCommand(){
        //ApplicationContextHolder.getApplicationContext()拿到ApplicationContext
        this.handler= ApplicationContextHolder.getApplicationContext()
        .getBean(RepairAppCommandHandler.class);
    }

    @Override
    public void execute (RepairApplication repairApplication) {
        handler.addRepairApplication(repairApplication);
    }
}
